﻿using System;
using System.Collections.Generic;

using RexToy.UI.WinForm;
using RexToy.UI.WinForm.Controls;
using RexToy.UI.WinForm.ViewModel;

namespace UnitTest.WinForm.SampleControl
{
    public class TestMenuForm : MDIContainerForm
    {
        public TestMenuForm()
        {
            var vm = this.ViewModel as TestMenuFormVM;
            vm.Delay = new ActionCommand(() =>
                {
                    System.Windows.Forms.MessageBox.Show("Delay OK");
                }
            );
        }

        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            if (System.Windows.Forms.MessageBox.Show(this, "Exit", "Confirm", System.Windows.Forms.MessageBoxButtons.OKCancel) != System.Windows.Forms.DialogResult.OK)
            {
                e.Cancel = true;
            }
        }
    }
}
